Skip to content

v0.3.22 Release#72

Merged
bradhe merged 6 commits intomainfrom
develop
Jul 25, 2025
Merged

v0.3.22 Release#72
bradhe merged 6 commits intomainfrom
develop

Conversation

@bradhe
Copy link
Contributor

@bradhe bradhe commented Jul 25, 2025

  • Integrity checks for packages uploaded to Tower

bradhe added 2 commits July 21, 2025 16:40
* feat: Manifests now have integrity checks embedded in them.

* chore: Add an overall integrity check to the file

* chore: Include an overall package hash during uploads

* chore: Rename integrity to checksum

* chore: Incorporate feedback from Copilot
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements integrity checks for packages uploaded to Tower by adding SHA256 checksums to package manifests and upload headers. The version is also updated from 0.3.21-rc.2 to 0.3.21 for the release.

  • Added SHA256 checksum computation for individual files and overall package integrity
  • Updated package manifest to include checksum field and modified upload process to send checksum header
  • Version bump from release candidate to stable release

Reviewed Changes

Copilot reviewed 7 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pyproject.toml Version update from 0.3.21rc2 to 0.3.21
Cargo.toml Version update from 0.3.21-rc.2 to 0.3.21
crates/tower-package/Cargo.toml Added sha2 dependency for checksum computation
crates/tower-package/src/lib.rs Added checksum field to Manifest struct and implemented SHA256 computation functions
crates/tower-package/tests/package_test.rs Added test assertion to verify checksum is populated
crates/tower-cmd/src/util/deploy.rs Added package hash computation and X-Tower-Checksum-SHA256 header to upload requests
crates/tower-cmd/src/util/progress.rs Minor formatting changes with extra blank lines

pyproject.toml Outdated
[project]
name = "tower"
version = "0.3.21rc2"
version = "0.3.21"
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number in pyproject.toml (0.3.21) doesn't match the PR title which indicates this is a v0.3.22 release. This inconsistency could cause deployment issues.

Suggested change
version = "0.3.21"
version = "0.3.22"

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed this.

Cargo.toml Outdated
[workspace.package]
edition = "2021"
version = "0.3.21-rc.2"
version = "0.3.21"
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version number in Cargo.toml (0.3.21) doesn't match the PR title which indicates this is a v0.3.22 release. This inconsistency could cause deployment issues.

Suggested change
version = "0.3.21"
version = "0.3.22"

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.


for key in sorted_keys {
// We need to sort the keys so that we can compute a consistent hash.
let value = path_hashes.get(key).unwrap();
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using unwrap() here could cause a panic if the key doesn't exist in the HashMap. Since we're iterating over keys from the same HashMap, this should be safe, but consider using expect() with a descriptive message for better error handling.

Suggested change
let value = path_hashes.get(key).unwrap();
let value = path_hashes.get(key).expect("Key not found in path_hashes during SHA256 computation");

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignoring for now, this needs a bit of work overall.

Ok(hash) => hash,
Err(e) => {
debug!("Failed to compute package hash: {}", e);
output::die("Tower CLI failed to properly prepare your package for deployment. Check that you have permissions to read/write to your temporary directory, and if it keeps happening contact Tower support at https://tower.dev");
Copy link

Copilot AI Jul 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message is very generic and doesn't provide specific information about the checksum computation failure. Consider including the actual error details to help users diagnose the issue.

Suggested change
output::die("Tower CLI failed to properly prepare your package for deployment. Check that you have permissions to read/write to your temporary directory, and if it keeps happening contact Tower support at https://tower.dev");
output::die(&format!("Tower CLI failed to properly prepare your package for deployment. Error: {}. Check that you have permissions to read/write to your temporary directory, and if it keeps happening contact Tower support at https://tower.dev", e));

Copilot uses AI. Check for mistakes.
@bradhe bradhe merged commit b77282a into main Jul 25, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants